package com.huluobo.a2207douyindemo.mine;

import androidx.lifecycle.MutableLiveData;

import com.huluobo.base.bean.CommonBeanResult;
import com.huluobo.base.bean.VideoBeanResult;
import com.huluobo.base.mvvm.BaseViewModel;

import java.util.List;

/**
 * Created by LC on 2024/9/20.
 */
public class MineViewModel extends BaseViewModel<MineRepo> {
    MutableLiveData<VideoBeanResult> getLikeVideosSuccess = new MutableLiveData<>();
    MutableLiveData<String> getLikeVideosFailed = new MutableLiveData<>();

    MutableLiveData<CommonBeanResult> noLikeVideoSuccess = new MutableLiveData<>();
    MutableLiveData<String> noLikeVideoFailed = new MutableLiveData<>();

    MutableLiveData<List<VideoBeanResult.VideoBean>> getCollectVideosSuccess = new MutableLiveData<>();
    MutableLiveData<String> getCollectVideosFailed = new MutableLiveData<>();

    MutableLiveData<String> deleteCollectSuccess = new MutableLiveData<>();
    MutableLiveData<String> deleteCollectFailed = new MutableLiveData<>();

    public void deleteCollectVideo(VideoBeanResult.VideoBean videoBean) {
        repo.deleteCollectVideo(videoBean, deleteCollectSuccess, deleteCollectFailed);
    }

    public void getCollectVideos() {
        repo.getCollectVideos(getCollectVideosSuccess, getCollectVideosFailed);
    }

    public void noLikeVideo(int videoId) {
        repo.noLikeVideo(videoId, noLikeVideoSuccess, noLikeVideoFailed);
    }

    public void getLikeVideos() {
        repo.getLikeVideos(getLikeVideosSuccess, getLikeVideosFailed);
    }

    @Override
    protected MineRepo createRepo() {
        return new MineRepo();
    }
}
